export default url => {
    const crud = window.$crud(url)
    const getMyList = () => window.$axios({
        url: `${url}/mylist`,
        method: 'get'
    })

    const getPrintList= () => window.$axios({
        url: `${url}/printlist`,
        method: 'get'
    })

    const updateState = (id,state) => window.$axios({
        url: `${url}/state/${id}/${state}`,
        method: 'put'
    })

    const getHistoryPage = (id,qureyData) => window.$axios({
        url: `${url}/history/page/${id}`,
        method: 'get',
        params:qureyData
    })
    const getHistoryList = (id) => window.$axios({
        url: `${url}/historys/${id}`,
        method: 'get'
    })


    const getHistory = (id) => window.$axios({
        url: `${url}/history/${id}`,
        method: 'get'
    })

    const updateHistory = (id,schemeId) => window.$axios({
        url: `${url}/history/${id}/${schemeId}`,
        method: 'put'
    })


    const getAuditorsByOtherApi = () => window.$axios({
        url: `other/role/getuserfuncitems`,
        method: 'get'
    })
    return {
        ...crud,
        getMyList,
        getPrintList,
        updateState,
    
        getHistoryPage,
        getHistoryList,
        getHistory,
        updateHistory,
        getAuditorsByOtherApi
    }
}